package pl.edu.agh.intobl;

import java.util.TimerTask;
import java.util.concurrent.TimeUnit;

import org.joone.net.NeuralNet;

public class XORApp {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		NetworkBuilder builder = new NetworkBuilder("resources/xor.txt");
		//build network ready for learning
		NeuralNet network = builder.buildNetwork();
		//start learning
		network.go();
		//save learned network
		try {
			TimeUnit.SECONDS.sleep(5);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		
		builder.saveNeuralNetwork("resources/xor.ser");
		
		//change network parameters to see some action
		builder.modifyToServingResults("resources/xor-out.txt");
		//test againts input
		network.go();
		
		try {
			TimeUnit.SECONDS.sleep(1);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}

}
